package edu.udel.mboch.towerdefense;

import java.util.ArrayList;

public abstract class Player implements Actor
{
	private static final long serialVersionUID = 9222071350867716252L;
	protected int cash;
	protected int lives;
	protected int income;
	protected String name;
	protected ArrayList<Tower> towers;
	
	public Player(String name)
	{
		this.name = name;
		income = 0;
		cash = 300;
		lives = 10;
		towers = new ArrayList<Tower>();
	}
	
	public Player(String name, int cash, int lives, int income, ArrayList<Tower> towers)
	{
		this.name = name;
		this.cash = cash;
		this.income = income;
		this.lives = lives;
		this.towers = towers;
	}
	
	public String getName()
	{
		return name;
	}
	
	public ArrayList<Tower> getTowers()
	{
		return towers;
	}
	
	public int getLives()
	{
		return lives;
	}
	
	public void addCash(int cash)
	{
		this.cash += cash;
	}
	
	public void takeLife()
	{
		lives -= 1;
	}
	
	public void generateIncome()
	{
		cash += income;
	}
	
	public void addIncome(int income)
	{
		this.income += income;
	}
	
	public int getIncome()
	{
		return income;
	}
	
	public int getCash()
	{
		return cash;
	}
	
	public abstract Player copy();
	
	public abstract TDMove getNextMove(TDState state);
	
	public abstract int getHeuristicScore(TDState state);
		
	public void print()
	{
		System.out.println(name + " has " + cash + " cash and " + lives + " lives and " + income + " income.");
	}
	
}
